#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

void solve() {
  string str;
  cin >> str;
  stack<char> st;
  for (char c : str) {
    if (c == '(') st.push(c);
    else if (c == ')') {
      if (st.empty()) {
        cout << "NO" << endl;
        return;
      }
      st.pop();
    }
  }
  if (st.empty()) cout << "YES" << endl;
  else cout << "NO" << endl;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int T = 1;
  // cin >> T;
  for (int cas = 1; cas <= T; cas ++) {
    solve();
  }
}